<?php
/**
 * Created by PhpStorm.
 * User: huynguyen
 * Date: 10/4/14
 * Time: 11:51 PM
 */

namespace Backend\Modules\Video\Forms;
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Hidden;
use Phalcon\Forms\Element\Submit;
use Phalcon\Forms\Element\Check;
use Phalcon\Forms\Element\Select;
use Phalcon\Forms\Element\Radio;
use Phalcon\Forms\Element\File;
use Common\Forms\BaseForm;
use Backend\Modules\Video\Models\National;
use Backend\Modules\Video\Models\VideoCategory;
use Common\Library\Common as LibraryCommon;

class FormSeachVideo extends BaseForm
{
    public function initialize($entity = null , $options = null)
    {
        $id = new Text('id' , array(
            'placeholder' => 'Id',
            'class' => 'form-control col-xs-12',
            //'name'  => 'name'
        ));
        $this->add($id);

        $name = new Text('name' , array(
            'placeholder' => '',
            'class' => 'form-control col-xs-12',
            //'name'  => 'name'
        ));
        $name->setLabel("Tên video");
        $this->add($name);

        $category = $national = new Select('category_id' , VideoCategory::fetchCategoryTree(0 , '' , '')  , array('using' => array('id' , 'name') , 'useEmpty' => true , 'emptyText' => 'Chọn thể loại' , 'emptyValue' => '' ,  'class' => 'form-control col-xs-12') );
        $category->setLabel('Thể loại');
        $this->add($category);

        $national = new Select('national_id' , National::find() , array('using' => array('id' , 'name') , 'useEmpty' => true , 'emptyText' => 'Chọn quốc gia' , 'emptyValue' => 0 ,  'class' => 'form-control col-xs-12') );
        $national->setLabel('Quốc gia');
        $this->add($national);

        // Sign Up
        $this->add(new Submit('submit', array(
            'class' => 'btn btn-primary btn-sm',

        )));
    }
} 